package org.wdcode.core.lucene.field;

import org.apache.lucene.document.Field;
import org.apache.lucene.document.Field.Index;
import org.apache.lucene.document.Field.Store;

/**
 * LuceneField工厂
 * @author WD
 * @since JDK6
 * @version 1.0 2010-07-14
 */
public final class LuceneFieldFactory {
	/**
	 * 获得LuceneField
	 * @param name 名称
	 * @param value 值
	 * @return LuceneField
	 */
	public final LuceneField getField(String name, String value) {
		return getField(name, value, Field.Store.YES, Field.Index.ANALYZED);
	}

	/**
	 * 获得LuceneField
	 * @param name 名称
	 * @param value 值
	 * @param store Store
	 * @param index Index
	 * @return LuceneField
	 */
	public final LuceneField getField(String name, String value, Store store, Index index) {
		return new LuceneFieldImpl(name, value, store, index);
	}

	/**
	 * 私有构造
	 */
	private LuceneFieldFactory() {}
}
